window.onload = function(){
//	获取目标
	var pass_input = document.getElementById("pass_input");
	var ints = pass_input.children;
	var buy = document.getElementById("buy");
	
//	正则
	var reg_pass = /\w/;

	for(var i = 0; i < ints.length; i++){
		ints[i].index = i;
		ints[i].onkeydown = function(){
			if(ints[ints.length - 1].value.length >= 1){
				ints[ints.length - 1].blur();
				return;
			}
			if(ints[this.index].value.length >= 1){
				ints[this.index + 1].focus();
			}	
		}
		if(ints[i].value === ""){
			buy.onclick = function(event){
				location.href = "pay_success.html";
				event.preventDefault();
			}
		}else{
			buy.onclick = function(event){
				location.href = "pay_flase.html";
				event.preventDefault();
			}
		}
	}
	
	
}
